package com.ssy.lingxi.report.repository.report;

import com.ssy.lingxi.report.entity.report.SubMemberReportDO;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 会员日报表
 * @author 伍将
 * @date 2020/11/9
 * @version 2.0.0
 */
public interface SubMemberReportRepository extends JpaRepository<SubMemberReportDO, Long>, JpaSpecificationExecutor<SubMemberReportDO> {

    /**
     * 删除指定范围会员日报表
     * @author 伍将
     * @date 2020/11/9
     * @param startTime:
     * @param endTime:
     * @return void
     **/
    @Transactional
    void deleteByDateTimeBetween(LocalDateTime startTime, LocalDateTime endTime);

    /**
     * 查询指定范围会员日注册数据
     * @author 伍将
     * @date 2020/11/10
     * @param startTime:
     * @param endTime:
     * @return java.util.List<com.ssy.lingxi.report.entity.report.SubMemberReportDO>
     **/
    List<SubMemberReportDO> getAllByMemberIdAndRoleIdAndDateTimeBetween(Long memberId,Long roleId,LocalDateTime startTime, LocalDateTime endTime);

}
